<?php
namespace app\admin\model;

use think\Exception;
use think\facade\Request;
use think\Model;
use think\model\concern\SoftDelete;

//vip 会员页
class Member extends Model{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $pk = "user_id";

    //会员列表页
     public static function   vipList($where,$data){
         $list=Member::where($where)->paginate([
             'list_rows'=> 6,
              'query'=>$data,
         ]);
         return $list;
     }

     //获取器
     public static function   getSexTextAttr($v,$data){
         if ($data['sex']==1){
             return '<font color="#6495ed">男</font>';
         }else{
             return '<font color="#ffc0cb">女</font>';
         }
     }

     //会员软删除
     public static function   vipDel($get){
       try{
           $res = Member::destroy($get['id']);
       }catch (Exception $e){
           $res=false;
       }
       return $res;



     }

}